<template>
  <div class="message-card">
    <div class="header">
      <h3 class="title">{{ actionType }}</h3>
      <span class="timestamp">{{ formatDateTime(createTime) }}</span>
    </div>
    <p class="content">{{ content }}</p>
  </div>
</template>

<script lang="ts" setup>
defineProps<{
  actionType: string
  content: string
  createTime: string
}>()

function formatDateTime(dt: string) {
  return dt?.replace('T', ' ').slice(0, 16) || '—'
}

</script>

<style scoped>
.message-card {
  background-color: #f9fafe;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.message-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.title {
  font-size: 18px;
  font-weight: 600;
  color: #1a202c;
  margin: 0;
}

.timestamp {
  font-size: 13px;
  color: #718096;
  white-space: nowrap;
}

.content {
  font-size: 15px;
  color: #2d3748;
  line-height: 1.6;
  margin: 0;
}
</style>
